﻿import java.util.Scanner;

public class Demo4 {
	public static void main(String[] args) {
		double R;
		String str;
		double C;
		double S;
		Scanner sc= new Scanner(System.in);
		System.out.println("输入半径：");
		while (!sc.hasNextDouble()) {
			System.out.println("输入有误，重新输入半径：");
			str = sc.next();
		}
		R = sc.nextDouble();
		if (R < 0) {
			System.out.println("半径不能为负数");
		} else {
			C = 2 * 3.14 * R;
			S = R * R * 3.14;
			System.out.println("周长是：" + C);
			System.out.println("面积是：" + S);
		}

	}
}
